#ifndef SEATSELECT_H
#define SEATSELECT_H

#include <QWidget>
#include"QPushButton"
namespace Ui {
class seatSelect;
}

class seatSelect : public QWidget
{
    Q_OBJECT

signals:
    void windowClosed(); // 自定义信号

public:
    explicit seatSelect(QWidget *parent = nullptr);
    ~seatSelect();

private slots:
    void on_pushButton_7_clicked();

    void on_pushButton_clicked();
    void keyPressEvent(QKeyEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);

    void on_pushButton_2_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_4_clicked();

    void on_checkBoxStateChanged(int state);

    void on_checkBoxStateChanged2(int state);

    void on_pushButton_5_clicked();


    void on_pushButton_6_clicked();

private:
    Ui::seatSelect *ui;
    int newIndex=0;
    QPoint initialMousePosition;
    bool isDragging = false;
    QString timeString = "";
    QString worktimeString = "";
    QString data = "";
    QString basicStyle = "QPushButton {"
                "color: black;"
                "border: 2px solid #e0ffff; /* 设置边框宽度和透明颜色 */"
                "border-radius: 10px; /* 设置圆角半径为20像素 */"
                "height: 40px;"
                "}"
                "QPushButton:hover {"
                "color: green; /* 鼠标悬停状态 */"
                "border: 2px solid #e0ffff; /* 设置边框宽度和透明颜色 */"
                "border-radius: 10px; /* 设置圆角半径为20像素 */"
                "height: 40px;"
                "}"
                "QPushButton:pressed {"
                "color: red; /* 按钮被按下状态 */"
                "border: 2px solid #e0ffff; /* 设置边框宽度和透明颜色 */"
                "border-radius: 10px; /* 设置圆角半径为20像素 */"
                "height: 40px;"
                "}";
    QString basicStyle2 =
        "QPushButton {" \
        "    color: black;" \
        "    border: 5px solid #e0ffff; /* 设置边框宽度和透明颜色 */" \
        "    border-radius: 20px; /* 设置圆角半径为20像素 */" \
        "}" \
        "QPushButton:hover {" \
        "    color: green; /* 鼠标悬停状态 */" \
        "    border: 5px solid #e0ffff; /* 设置边框宽度和透明颜色 */" \
        "    border-radius: 20px; /* 设置圆角半径为20像素 */" \
        "}" \
        "QPushButton:pressed {" \
        "    color: red; /* 按钮被按下状态 */" \
        "    border: 5px solid #e0ffff; /* 设置边框宽度和透明颜色 */" \
        "    border-radius: 20px; /* 设置圆角半径为20像素 */" \
        "}";

    bool seat_selected=false;

public:
    void handleSeatClose(int index);
    void onSeatClicked(int index,QPushButton *button);
    static QString seatName;
    void updateSeats();
};

#endif // SEATSELECT_H
